<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('延期申请')" />
    <th:block th:include="include :: select2-css" />
</head>
<body>
<div class="main-content">
    <form class="form-horizontal m" id="form-assignment-edit" th:object="${delayapply}">
        <input name="id" id="id" type="hidden" th:field="*{aid}"  />
        <div class="form-group">
            <label class="col-sm-3 control-label">任务标题：</label>
            <div class="col-sm-9">
                <input type="text" name="title" readonly="readonly" th:field="*{title}" style="width: 200px" class="form-control" placeholder="请输入文本">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">任务内容：</label>
            <div class="col-sm-9">
                <input type="text" name="content" readonly="readonly" th:field="*{content}"  class="form-control" placeholder="请输入文本">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">完成时间：</label>
            <div class="col-sm-9">
                <input type="text" name="startDate"  readonly="readonly" th:value="${#dates.format(delayapply.startDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" style="width: 200px" >
            </div>
            <div class="col-sm-9" style="margin-left: 400px;margin-top: -33px" >
                <span>--</span>
            </div>
            <div class="col-sm-9" style="margin-left: 430px;margin-top: -33px" >
                <input type="text"   readonly="readonly" th:value="${#dates.format(owerDate, 'yyyy-MM-dd')}" class="form-control" style="width: 200px"  placeholder="yyyy-MM-dd" >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">延期时间：</label>
            <div class="col-sm-9">
                <input type="text" name="endDate" th:value="${#dates.format(delayapply.endDate, 'yyyy-MM-dd')}" class="form-control" style="width: 200px" value="2018-04-20">
            </div>
        </div>


       <div class="form-group">
              <label class="col-sm-3 control-label">申请人：</label>
              <div class="col-sm-9">
                  <input type="text" name="aname" readonly="readonly" th:field="*{aname}"  style="width: 200px" class="form-control" placeholder="请输入文本">
              </div>
          </div>

        <div class="form-group">
             <label class="col-sm-3 control-label">延期原因：</label>
             <div class="col-sm-9">
                 <input type="text" name="cause" th:field="*{cause}" class="form-control" placeholder="请输入文本">
             </div>
         </div>
         <div class="form-group">
             <label class="col-sm-3 control-label" >是否同意：</label>
             <div class="col-sm-9" style="width: 200px">
                 <select class="form-control" id="astatus" th:field="*{astatus}" name="astatus">
                     <option value="2">请选择</option>
                     <option value="0">同意：</option>
                     <option value="1">不同意：</option>
                 </select>
             </div>
         </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">意见：</label>
            <div class="col-sm-9">
                <input type="text" name="opinion" class="form-control" placeholder="请输入文本">
            </div>
        </div>
    </form>

</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script type="text/javascript">
    var prefix = ctx + "cms/taskdelaycheck";


    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-assignment-edit").serializeArray();
            $.operate.save(prefix + "/editSave",data);

        }
    }
    /*部门管理-修改-选择部门树*/
    function selectDeptTree() {
        var deptId = $("#treeId").val();
        if(deptId > 0) {
            var options = {
                title: '部门选择',
                width: "380",
                url: prefix + "/selectDeptTree/" + $("#treeId").val(),
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        } else {
            $.modal.alertError("父部门不能选择");
        }
    }

    function doSubmit(index, layero){
        var tree = layero.find("iframe")[0].contentWindow.$._tree;
        alert(tree);
        if ($.tree.notAllowLastLevel(tree)) {
            var body = layer.getChildFrame('body', index);
            $("#treeId").val(body.find('#treeId').val());
            $("#treeName").val(body.find('#treeName').val());
            layer.close(index);
        }
    }

</script>
</body>
</html>